﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Categories.aspx.cs" Inherits="WebApplicationRating.Views.Categories" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:Label ID="lblException" runat="server" Text=" " style="margin-left: 30px" Font-Bold="true" foreColor="Orange" ></asp:Label>
  <p> </p>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=imageEntities" DefaultContainerName="imageEntities" 
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="Categories">
    </asp:EntityDataSource>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="categoryid" 
        DataSourceID="EntityDataSource1" 
        onselectedindexchanged="GridView1_SelectedIndexChanged"
        onrowdeleted="GridView1_RowDeleted">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="category_name" HeaderText="category_name" 
                SortExpression="category_name" />
        </Columns>
    </asp:GridView>
    <br />
    <br />
    <asp:TextBox ID="categoryName" runat="server" Width="190px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="newCategoryButton" runat="server" onclick="NewCategoryButton_Click" Text="Add Category" />
    <br />
</asp:Content>
